import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

class Question {
    private String questionText;
    private String correctAnswer;

    public Question(String questionText, String correctAnswer) {
        this.questionText = questionText;
        this.correctAnswer = correctAnswer;
    }

    public String getQuestionText() {
        return questionText;
    }

    public String getCorrectAnswer() {
        return correctAnswer;
    }

    public boolean checkAnswer(String answer) {
        return correctAnswer.equalsIgnoreCase(answer.trim());
    }
}

class Survey {
    private List<Question> questions;

    public Survey() {
        questions = new ArrayList<>();
    }

    public void addQuestion(Question question) {
        questions.add(question);
    }

    public void conductSurvey() {
        Scanner scanner = new Scanner(System.in);
        int score = 0;

        for (Question question : questions) {
            System.out.println(question.getQuestionText());
            String answer = scanner.nextLine();

            if (question.checkAnswer(answer)) {
                System.out.println("Correct!");
                score++;
            } else {
                System.out.println("Incorrect. The correct answer is: " + question.getCorrectAnswer());
            }
        }

        System.out.println("Your total score is: " + score + " out of " + questions.size());
        scanner.close();
    }
}

public class SurveyProgram {
    public static void main(String[] args) {
        Survey survey = new Survey();

        // Adding questions to the survey
        survey.addQuestion(new Question("What is the capital of France?", "Paris"));
        survey.addQuestion(new Question("What is 2 + 2?", "4"));
        survey.addQuestion(new Question("Who wrote 'Romeo and Juliet'?", "Shakespeare"));

        // Conduct the survey
        survey.conductSurvey();
    }
}
